from __future__ import division

from core import *


class FertilityDependent(Object):
    resistance =_ (0)
    
    @property
    def fertility(self):
        return sum(tile.fertility for tile in self.tiles) / len(self.tiles)

    @property
    def fertility_modifier(self):
        return self.resistance + (1 - self.resistance) * self.fertility
